package com.test.designPattern.behaviorType.chainOfResponsibilityPattern;

import lombok.extern.slf4j.Slf4j;

/**
 * 具体处理者2
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/4/8
 */
@Slf4j
public class ConcreteHandler2 extends Handler {

    @Override
    public void handleMessage(int type) {
        if (type == 2) {
            log.info("ConcreteHandler2解决了问题！");
        } else {
            log.info("ConcreteHandler2解决不了问题！");
            if (nextHandler != null) {
                nextHandler.handleMessage(type);
            } else {
                log.info("没有人能处理这个消息");
            }
        }
    }
}
